import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);
// 登录验证
export default new Vuex.Store({
    state: {
        user: false
    },
    mutations: {
        // 登录
        login(state, adminName) {
            state.adminName = adminName;
            localStorage.setItem("adminName", adminName);
        },
        // 退出
        logout(state, adminName) {
            state.adminName = "";
            localStorage.setItem("adminName", "");
        }
    }
})
